import React, { Component } from 'react';
import { withRouter } from 'react-router-dom';
import classNames from 'classnames';

import "./less/leftbar.css";

import { URL } from '../../config';

class App extends Component {

  handleClick (ref) {
    switch (ref) {
      case "settings":
        this.props.history.push(URL.project_setting_page + this.props.location.search);
        break;
      default:
        this.props.history.push(URL.main_page);
    }
  }

  render () {
    return (
      <ul className="leftbar">
        <li onClick={this.handleClick.bind(this, "settings")} className={classNames("baritem", this.props.location.pathname === URL.editserv_page || this.props.location.pathname === URL.addserv_page ? "selected" : null)}>
          <i className={classNames("icon", "settings")}>&#xe62e;</i>
          编辑微服务
        </li>
      </ul>
    )
  }
}

export default withRouter(App);